package com.jpush.gateway.config;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.server.WebFilterExchange;
import org.springframework.security.web.server.authentication.logout.ServerLogoutHandler;
import reactor.core.publisher.Mono;

public class WebFluxServerLogoutHandler implements ServerLogoutHandler {
    @Override
    public Mono<Void> logout(WebFilterExchange exchange, Authentication authentication) {
        return Mono.just(authentication).map(Authentication::getDetails).flatMap(details -> {
             return logout();
        }).switchIfEmpty(Mono.empty());
    }

    private  Mono<Void> logout(){
        return  Mono.empty();
    }
}